package exam.demo2;

import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (true){
            long a = in.nextLong();
            String s = String.valueOf(a);
            int len = s.length();

            int number = (len - 1) / 3;
            int n = number;

            for (int i = 0; i < n; i++) {
//            s = s.substring(0, s.length()-(3*(i+1)) - (i+1)) + "," + s.substring(s.length()-(3*(i+1) - (i+1)), s.length());
                s = s.substring(0, len - (3 * (i + 1))) + "," + s.substring(len - (3 * (i + 1)), s.length());
            }
            System.out.println(s);
        }
    }
}
